package bookstudytest.Exception;

/**
 * Created by swordbone on 2017/12/11.
 */
public class ThrowExceptionTest {
    public static void main(String[] args){
        try {
//            new ThrowExceptionTest().dosomething("我是你哥");
            new ThrowExceptionTest().dosomething("李衡");
        } catch (DefinedException e) {
            e.printStackTrace();
        }
    }

    public void dosomething(String thing) throws DefinedException {
        if (thing.equals("我是你哥")){
            throw new DefinedException("没人会是我哥！");
        }else {
            System.out.println(thing+"大哥你好！");
        }
    }

}
